 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

back source configuration openapi
back source configuration openapi

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKOssopenapi/OssopenapiModel.h>

@implementation BucketCapacityStatistic
-(id) initWithBucketName:(NSString*) bucketName
      value:(NSNumber*)value
      time:(NSString*)time
      capacityType:(NSNumber*)capacityType { 
     self.bucketName = bucketName;               
     self.value = value;               
     self.time = time;               
     self.capacityType = capacityType;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self bucketName])
    {
        [result setValue:[self bucketName] forKey:@"bucketName"];
    }
    if([self value])
    {
        [result setValue:[self value] forKey:@"value"];
    }
    if([self time])
    {
        [result setValue:[self time] forKey:@"time"];
    }
    if([self capacityType])
    {
        [result setValue:[self capacityType] forKey:@"capacityType"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.bucketName = [dictionary objectForKey:@"bucketName"];
    self.value = [dictionary objectForKey:@"value"];
    self.time = [dictionary objectForKey:@"time"];
    self.capacityType = [dictionary objectForKey:@"capacityType"];
    return self;
}
 @end
@implementation SingleBucketCapacityRequestCondition
-(id) initWithCapacityTypes:(NSArray<NSNumber*>*) capacityTypes
      beginTime:(NSString*)beginTime
      endTime:(NSString*)endTime
      periodType:(NSNumber*)periodType
      method:(NSNumber*)method { 
     self.capacityTypes = capacityTypes;               
     self.beginTime = beginTime;               
     self.endTime = endTime;               
     self.periodType = periodType;               
     self.method = method;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self capacityTypes])
    {
        [result setValue:[self capacityTypes] forKey:@"capacityTypes"];
    }
    if([self beginTime])
    {
        [result setValue:[self beginTime] forKey:@"beginTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self periodType])
    {
        [result setValue:[self periodType] forKey:@"periodType"];
    }
    if([self method])
    {
        [result setValue:[self method] forKey:@"method"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.capacityTypes = [dictionary objectForKey:@"capacityTypes"];
    self.beginTime = [dictionary objectForKey:@"beginTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.periodType = [dictionary objectForKey:@"periodType"];
    self.method = [dictionary objectForKey:@"method"];
    return self;
}
 @end
@implementation BucketCapacityCondition
-(id) initWithCapacityTypes:(NSArray<NSNumber*>*) capacityTypes
      beginTime:(NSString*)beginTime
      endTime:(NSString*)endTime
      periodType:(NSNumber*)periodType
      method:(NSNumber*)method
      bucketNames:(NSArray<NSString*>*)bucketNames { 
     self.capacityTypes = capacityTypes;               
     self.beginTime = beginTime;               
     self.endTime = endTime;               
     self.periodType = periodType;               
     self.method = method;               
     self.bucketNames = bucketNames;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self capacityTypes])
    {
        [result setValue:[self capacityTypes] forKey:@"capacityTypes"];
    }
    if([self beginTime])
    {
        [result setValue:[self beginTime] forKey:@"beginTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self periodType])
    {
        [result setValue:[self periodType] forKey:@"periodType"];
    }
    if([self method])
    {
        [result setValue:[self method] forKey:@"method"];
    }
    if([self bucketNames])
    {
        [result setValue:[self bucketNames] forKey:@"bucketNames"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.capacityTypes = [dictionary objectForKey:@"capacityTypes"];
    self.beginTime = [dictionary objectForKey:@"beginTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.periodType = [dictionary objectForKey:@"periodType"];
    self.method = [dictionary objectForKey:@"method"];
    self.bucketNames = [dictionary objectForKey:@"bucketNames"];
    return self;
}
 @end
@implementation CName
-(id) initWithId:(NSNumber*) idValue
      pin:(NSString*)pin
      originDomain:(NSString*)originDomain
      cname:(NSString*)cname
      status:(NSNumber*)status
      bucketName:(NSString*)bucketName
      isCName:(NSNumber*)isCName
      createTime:(NSString*)createTime
      protoType:(NSNumber*)protoType { 
     self.idValue = idValue;               
     self.pin = pin;               
     self.originDomain = originDomain;               
     self.cname = cname;               
     self.status = status;               
     self.bucketName = bucketName;               
     self.isCName = isCName;               
     self.createTime = createTime;               
     self.protoType = protoType;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self pin])
    {
        [result setValue:[self pin] forKey:@"pin"];
    }
    if([self originDomain])
    {
        [result setValue:[self originDomain] forKey:@"originDomain"];
    }
    if([self cname])
    {
        [result setValue:[self cname] forKey:@"cname"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self bucketName])
    {
        [result setValue:[self bucketName] forKey:@"bucketName"];
    }
    if([self isCName])
    {
        [result setValue:[self isCName] forKey:@"isCName"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    if([self protoType])
    {
        [result setValue:[self protoType] forKey:@"protoType"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    self.pin = [dictionary objectForKey:@"pin"];
    self.originDomain = [dictionary objectForKey:@"originDomain"];
    self.cname = [dictionary objectForKey:@"cname"];
    self.status = [dictionary objectForKey:@"status"];
    self.bucketName = [dictionary objectForKey:@"bucketName"];
    self.isCName = [dictionary objectForKey:@"isCName"];
    self.createTime = [dictionary objectForKey:@"createTime"];
    self.protoType = [dictionary objectForKey:@"protoType"];
    return self;
}
 @end
@implementation CNameInfo
-(id) initWithCname:(NSString*) cname
      protoType:(NSNumber*)protoType
      endPoint:(NSString*)endPoint
      internal:(NSString*)internal { 
     self.cname = cname;               
     self.protoType = protoType;               
     self.endPoint = endPoint;               
     self.internal = internal;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self cname])
    {
        [result setValue:[self cname] forKey:@"cname"];
    }
    if([self protoType])
    {
        [result setValue:[self protoType] forKey:@"protoType"];
    }
    if([self endPoint])
    {
        [result setValue:[self endPoint] forKey:@"endPoint"];
    }
    if([self internal])
    {
        [result setValue:[self internal] forKey:@"internal"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.cname = [dictionary objectForKey:@"cname"];
    self.protoType = [dictionary objectForKey:@"protoType"];
    self.endPoint = [dictionary objectForKey:@"endPoint"];
    self.internal = [dictionary objectForKey:@"internal"];
    return self;
}
 @end
@implementation UserBillCode
-(id) initWithAppCode:(NSString*) appCode
      serviceCode:(NSString*)serviceCode
      storageResourceType:(NSString*)storageResourceType
      processResourceType:(NSString*)processResourceType { 
     self.appCode = appCode;               
     self.serviceCode = serviceCode;               
     self.storageResourceType = storageResourceType;               
     self.processResourceType = processResourceType;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self appCode])
    {
        [result setValue:[self appCode] forKey:@"appCode"];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self storageResourceType])
    {
        [result setValue:[self storageResourceType] forKey:@"storageResourceType"];
    }
    if([self processResourceType])
    {
        [result setValue:[self processResourceType] forKey:@"processResourceType"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.appCode = [dictionary objectForKey:@"appCode"];
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.storageResourceType = [dictionary objectForKey:@"storageResourceType"];
    self.processResourceType = [dictionary objectForKey:@"processResourceType"];
    return self;
}
 @end
@implementation ImageExtensions
-(id) initWithImageExtensionsValue:(NSString*) imageExtensionsValue { 
     self.imageExtensionsValue = imageExtensionsValue;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self imageExtensionsValue])
    {
        [result setValue:[self imageExtensionsValue] forKey:@"imageExtensions"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.imageExtensionsValue = [dictionary objectForKey:@"imageExtensions"];
    return self;
}
 @end
@implementation BucketMonitorStatistic
-(id) initWithBucketName:(NSString*) bucketName
      count:(NSNumber*)count
      time:(NSString*)time { 
     self.bucketName = bucketName;               
     self.count = count;               
     self.time = time;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self bucketName])
    {
        [result setValue:[self bucketName] forKey:@"bucketName"];
    }
    if([self count])
    {
        [result setValue:[self count] forKey:@"count"];
    }
    if([self time])
    {
        [result setValue:[self time] forKey:@"time"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.bucketName = [dictionary objectForKey:@"bucketName"];
    self.count = [dictionary objectForKey:@"count"];
    self.time = [dictionary objectForKey:@"time"];
    return self;
}
 @end
@implementation BucketSpaceStatistic
-(id) initWithBucketName:(NSString*) bucketName
      space:(NSNumber*)space { 
     self.bucketName = bucketName;               
     self.space = space;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self bucketName])
    {
        [result setValue:[self bucketName] forKey:@"bucketName"];
    }
    if([self space])
    {
        [result setValue:[self space] forKey:@"space"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.bucketName = [dictionary objectForKey:@"bucketName"];
    self.space = [dictionary objectForKey:@"space"];
    return self;
}
 @end
@implementation ICP
-(id) initWithIcp:(NSNumber*) icp { 
     self.icp = icp;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self icp])
    {
        [result setValue:[self icp] forKey:@"icp"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.icp = [dictionary objectForKey:@"icp"];
    return self;
}
 @end
@implementation SignatureInfo
-(id) initWithEndpoint:(NSString*) endpoint
      httpMethod:(NSString*)httpMethod
      resourcePath:(NSString*)resourcePath
      xAmzContentSha256:(NSString*)xAmzContentSha256
      additionalSignatureHeaders:(NSMutableDictionary<NSString*,NSString*>*)additionalSignatureHeaders
      signatureParameters:(NSMutableDictionary<NSString*,NSString*>*)signatureParameters { 
     self.endpoint = endpoint;               
     self.httpMethod = httpMethod;               
     self.resourcePath = resourcePath;               
     self.xAmzContentSha256 = xAmzContentSha256;               
     self.additionalSignatureHeaders = additionalSignatureHeaders;               
     self.signatureParameters = signatureParameters;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self endpoint])
    {
        [result setValue:[self endpoint] forKey:@"endpoint"];
    }
    if([self httpMethod])
    {
        [result setValue:[self httpMethod] forKey:@"httpMethod"];
    }
    if([self resourcePath])
    {
        [result setValue:[self resourcePath] forKey:@"resourcePath"];
    }
    if([self xAmzContentSha256])
    {
        [result setValue:[self xAmzContentSha256] forKey:@"xAmzContentSha256"];
    }
    if([self additionalSignatureHeaders])
    {
        [result setValue:[self additionalSignatureHeaders] forKey:@"additionalSignatureHeaders"];
    }
    if([self signatureParameters])
    {
        [result setValue:[self signatureParameters] forKey:@"signatureParameters"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.endpoint = [dictionary objectForKey:@"endpoint"];
    self.httpMethod = [dictionary objectForKey:@"httpMethod"];
    self.resourcePath = [dictionary objectForKey:@"resourcePath"];
    self.xAmzContentSha256 = [dictionary objectForKey:@"xAmzContentSha256"];
    self.additionalSignatureHeaders = [dictionary objectForKey:@"additionalSignatureHeaders"];
    self.signatureParameters = [dictionary objectForKey:@"signatureParameters"];
    return self;
}
 @end
@implementation SignatureResult
-(id) initWithEndpoint:(NSString*) endpoint
      httpMethod:(NSString*)httpMethod
      resourcePath:(NSString*)resourcePath
      xAmzDate:(NSString*)xAmzDate
      xAmzContentSha256:(NSString*)xAmzContentSha256
      xAmzMetaRequesterPin:(NSString*)xAmzMetaRequesterPin
      xAmzMetaRequesterId:(NSString*)xAmzMetaRequesterId
      additionalSignatureHeaders:(NSMutableDictionary<NSString*,NSString*>*)additionalSignatureHeaders
      signatureParameters:(NSMutableDictionary<NSString*,NSString*>*)signatureParameters
      authorization:(NSString*)authorization { 
     self.endpoint = endpoint;               
     self.httpMethod = httpMethod;               
     self.resourcePath = resourcePath;               
     self.xAmzDate = xAmzDate;               
     self.xAmzContentSha256 = xAmzContentSha256;               
     self.xAmzMetaRequesterPin = xAmzMetaRequesterPin;               
     self.xAmzMetaRequesterId = xAmzMetaRequesterId;               
     self.additionalSignatureHeaders = additionalSignatureHeaders;               
     self.signatureParameters = signatureParameters;               
     self.authorization = authorization;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self endpoint])
    {
        [result setValue:[self endpoint] forKey:@"endpoint"];
    }
    if([self httpMethod])
    {
        [result setValue:[self httpMethod] forKey:@"httpMethod"];
    }
    if([self resourcePath])
    {
        [result setValue:[self resourcePath] forKey:@"resourcePath"];
    }
    if([self xAmzDate])
    {
        [result setValue:[self xAmzDate] forKey:@"xAmzDate"];
    }
    if([self xAmzContentSha256])
    {
        [result setValue:[self xAmzContentSha256] forKey:@"xAmzContentSha256"];
    }
    if([self xAmzMetaRequesterPin])
    {
        [result setValue:[self xAmzMetaRequesterPin] forKey:@"xAmzMetaRequesterPin"];
    }
    if([self xAmzMetaRequesterId])
    {
        [result setValue:[self xAmzMetaRequesterId] forKey:@"xAmzMetaRequesterId"];
    }
    if([self additionalSignatureHeaders])
    {
        [result setValue:[self additionalSignatureHeaders] forKey:@"additionalSignatureHeaders"];
    }
    if([self signatureParameters])
    {
        [result setValue:[self signatureParameters] forKey:@"signatureParameters"];
    }
    if([self authorization])
    {
        [result setValue:[self authorization] forKey:@"authorization"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.endpoint = [dictionary objectForKey:@"endpoint"];
    self.httpMethod = [dictionary objectForKey:@"httpMethod"];
    self.resourcePath = [dictionary objectForKey:@"resourcePath"];
    self.xAmzDate = [dictionary objectForKey:@"xAmzDate"];
    self.xAmzContentSha256 = [dictionary objectForKey:@"xAmzContentSha256"];
    self.xAmzMetaRequesterPin = [dictionary objectForKey:@"xAmzMetaRequesterPin"];
    self.xAmzMetaRequesterId = [dictionary objectForKey:@"xAmzMetaRequesterId"];
    self.additionalSignatureHeaders = [dictionary objectForKey:@"additionalSignatureHeaders"];
    self.signatureParameters = [dictionary objectForKey:@"signatureParameters"];
    self.authorization = [dictionary objectForKey:@"authorization"];
    return self;
}
 @end
@implementation BackSourceAddress
-(id) initWithProtocol:(NSString*) protocol
      hostName:(NSString*)hostName
      replaceKeyPrefixWith:(NSString*)replaceKeyPrefixWith
      replaceKeyWith:(NSString*)replaceKeyWith
      replaceKeySuffixWith:(NSString*)replaceKeySuffixWith { 
     self.protocol = protocol;               
     self.hostName = hostName;               
     self.replaceKeyPrefixWith = replaceKeyPrefixWith;               
     self.replaceKeyWith = replaceKeyWith;               
     self.replaceKeySuffixWith = replaceKeySuffixWith;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self protocol])
    {
        [result setValue:[self protocol] forKey:@"protocol"];
    }
    if([self hostName])
    {
        [result setValue:[self hostName] forKey:@"hostName"];
    }
    if([self replaceKeyPrefixWith])
    {
        [result setValue:[self replaceKeyPrefixWith] forKey:@"replaceKeyPrefixWith"];
    }
    if([self replaceKeyWith])
    {
        [result setValue:[self replaceKeyWith] forKey:@"replaceKeyWith"];
    }
    if([self replaceKeySuffixWith])
    {
        [result setValue:[self replaceKeySuffixWith] forKey:@"replaceKeySuffixWith"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.protocol = [dictionary objectForKey:@"protocol"];
    self.hostName = [dictionary objectForKey:@"hostName"];
    self.replaceKeyPrefixWith = [dictionary objectForKey:@"replaceKeyPrefixWith"];
    self.replaceKeyWith = [dictionary objectForKey:@"replaceKeyWith"];
    self.replaceKeySuffixWith = [dictionary objectForKey:@"replaceKeySuffixWith"];
    return self;
}
 @end
@implementation BackSourceHeaderRule
-(id) initWithAllowAllHeaders:(NSNumber*) allowAllHeaders
      allowHeaders:(NSArray<NSString*>*)allowHeaders
      notAllowHeaders:(NSArray<NSString*>*)notAllowHeaders
      setHeaders:(NSMutableDictionary<NSString*,NSString*>*)setHeaders { 
     self.allowAllHeaders = allowAllHeaders;               
     self.allowHeaders = allowHeaders;               
     self.notAllowHeaders = notAllowHeaders;               
     self.setHeaders = setHeaders;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self allowAllHeaders])
    {
        [result setValue:[self allowAllHeaders] forKey:@"allowAllHeaders"];
    }
    if([self allowHeaders])
    {
        [result setValue:[self allowHeaders] forKey:@"allowHeaders"];
    }
    if([self notAllowHeaders])
    {
        [result setValue:[self notAllowHeaders] forKey:@"notAllowHeaders"];
    }
    if([self setHeaders])
    {
        [result setValue:[self setHeaders] forKey:@"setHeaders"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.allowAllHeaders = [dictionary objectForKey:@"allowAllHeaders"];
    self.allowHeaders = [dictionary objectForKey:@"allowHeaders"];
    self.notAllowHeaders = [dictionary objectForKey:@"notAllowHeaders"];
    self.setHeaders = [dictionary objectForKey:@"setHeaders"];
    return self;
}
 @end
@implementation BackSourceRuleCondition
-(id) initWithKeyPrefixEquals:(NSString*) keyPrefixEquals
      httpErrorCodeReturnedEquals:(NSNumber*)httpErrorCodeReturnedEquals { 
     self.keyPrefixEquals = keyPrefixEquals;               
     self.httpErrorCodeReturnedEquals = httpErrorCodeReturnedEquals;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self keyPrefixEquals])
    {
        [result setValue:[self keyPrefixEquals] forKey:@"keyPrefixEquals"];
    }
    if([self httpErrorCodeReturnedEquals])
    {
        [result setValue:[self httpErrorCodeReturnedEquals] forKey:@"httpErrorCodeReturnedEquals"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.keyPrefixEquals = [dictionary objectForKey:@"keyPrefixEquals"];
    self.httpErrorCodeReturnedEquals = [dictionary objectForKey:@"httpErrorCodeReturnedEquals"];
    return self;
}
 @end
@implementation BucketCapacityQueryResult
-(id) initWithResultList:(NSArray<BucketCapacityStatistic*>*) resultList { 
     self.resultList = resultList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self resultList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self resultList] count]; i++) {
            BucketCapacityStatistic* item = [[self resultList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"resultList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* resultListArray = [dictionary objectForKey:@"resultList"];
    if(resultListArray&&![resultListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [resultListArray count];i++)
        {
            BucketCapacityStatistic* item = [[BucketCapacityStatistic alloc]initWithDic:[resultListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.resultList = propertyArray;
    }
    return self;
}
 @end
@implementation CNameQueryResult
-(id) initWithTotalCount:(NSNumber*) totalCount
      resultList:(NSArray<CName*>*)resultList { 
     self.totalCount = totalCount;               
     self.resultList = resultList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    if([self resultList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self resultList] count]; i++) {
            CName* item = [[self resultList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"resultList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    NSArray* resultListArray = [dictionary objectForKey:@"resultList"];
    if(resultListArray&&![resultListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [resultListArray count];i++)
        {
            CName* item = [[CName alloc]initWithDic:[resultListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.resultList = propertyArray;
    }
    return self;
}
 @end
@implementation BucketSpaceStatisticQueryResult
-(id) initWithTotalCount:(NSNumber*) totalCount
      queryList:(NSArray<BucketSpaceStatistic*>*)queryList { 
     self.totalCount = totalCount;               
     self.queryList = queryList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    if([self queryList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self queryList] count]; i++) {
            BucketSpaceStatistic* item = [[self queryList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"queryList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    NSArray* queryListArray = [dictionary objectForKey:@"queryList"];
    if(queryListArray&&![queryListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [queryListArray count];i++)
        {
            BucketSpaceStatistic* item = [[BucketSpaceStatistic alloc]initWithDic:[queryListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.queryList = propertyArray;
    }
    return self;
}
 @end
@implementation BucketMonitorStatisticQueryResult
-(id) initWithTotalCount:(NSNumber*) totalCount
      queryList:(NSArray<BucketMonitorStatistic*>*)queryList { 
     self.totalCount = totalCount;               
     self.queryList = queryList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    if([self queryList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self queryList] count]; i++) {
            BucketMonitorStatistic* item = [[self queryList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"queryList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    NSArray* queryListArray = [dictionary objectForKey:@"queryList"];
    if(queryListArray&&![queryListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [queryListArray count];i++)
        {
            BucketMonitorStatistic* item = [[BucketMonitorStatistic alloc]initWithDic:[queryListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.queryList = propertyArray;
    }
    return self;
}
 @end
@implementation BackSourceRule
-(id) initWithBackSourceType:(NSString*) backSourceType
      condition:(BackSourceRuleCondition*)condition
      address:(BackSourceAddress*)address
      allowQueryString:(NSNumber*)allowQueryString
      followRedirects:(NSNumber*)followRedirects
      headerRule:(BackSourceHeaderRule*)headerRule { 
     self.backSourceType = backSourceType;               
     self.condition = condition;               
     self.address = address;               
     self.allowQueryString = allowQueryString;               
     self.followRedirects = followRedirects;               
     self.headerRule = headerRule;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self backSourceType])
    {
        [result setValue:[self backSourceType] forKey:@"backSourceType"];
    }
    if([self condition])
    {
        [result setValue:[[self condition] dictionary]forKey:@"condition"];
    }
    if([self address])
    {
        [result setValue:[[self address] dictionary]forKey:@"address"];
    }
    if([self allowQueryString])
    {
        [result setValue:[self allowQueryString] forKey:@"allowQueryString"];
    }
    if([self followRedirects])
    {
        [result setValue:[self followRedirects] forKey:@"followRedirects"];
    }
    if([self headerRule])
    {
        [result setValue:[[self headerRule] dictionary]forKey:@"headerRule"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.backSourceType = [dictionary objectForKey:@"backSourceType"];
    self.condition = [[BackSourceRuleCondition alloc]initWithDic:[dictionary objectForKey:@"condition"]];
    self.address = [[BackSourceAddress alloc]initWithDic:[dictionary objectForKey:@"address"]];
    self.allowQueryString = [dictionary objectForKey:@"allowQueryString"];
    self.followRedirects = [dictionary objectForKey:@"followRedirects"];
    self.headerRule = [[BackSourceHeaderRule alloc]initWithDic:[dictionary objectForKey:@"headerRule"]];
    return self;
}
 @end
@implementation BucketBackSourceConfiguration
-(id) initWithBackSourceRules:(NSArray<BackSourceRule*>*) backSourceRules { 
     self.backSourceRules = backSourceRules;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self backSourceRules])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self backSourceRules] count]; i++) {
            BackSourceRule* item = [[self backSourceRules] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"backSourceRules"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* backSourceRulesArray = [dictionary objectForKey:@"backSourceRules"];
    if(backSourceRulesArray&&![backSourceRulesArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [backSourceRulesArray count];i++)
        {
            BackSourceRule* item = [[BackSourceRule alloc]initWithDic:[backSourceRulesArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.backSourceRules = propertyArray;
    }
    return self;
}
 @end
 
 


